﻿<%@ Page Title="Programmatic Creation" Language="C#" MasterPageFile="~/Demo.master"
    Inherits="DemoPage" StylesheetTheme="humanity" %>

<%@ Register Src="~/CodeFormatter.ascx" TagName="Code" TagPrefix="demo" %>

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            NavView view = new NavView();
            view.ShowItemIcon = true;
            view.Text = "Server MailBox";
            Accordion1.Views.Add(view);
            view.Items.Add(new NavItem("InBox(126)"));
            view.Items.Add(new NavItem("SendBox"));
            view.Items.Add(new NavItem("OutBox"));
        }
    }
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="DemoHolder" runat="Server">
    <div class="dna-state-help ui-corner-all" style="margin-bottom: 10px;">
        Creating the NavView on server side.
    </div>
    <demo:Code runat="server" ID="navcodes" Language="c#">
        <CodeTemplate>protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        NavView view = new NavView();
        view.ShowItemIcon = true;
        view.Text = "Server MailBox";
        Accordion1.Views.Add(view);
        view.Items.Add(new NavItem("InBox(126)"));
        view.Items.Add(new NavItem("SendBox"));
        view.Items.Add(new NavItem("OutBox"));
    }
}
        </CodeTemplate>
    </demo:Code>
    <br />
    <DotNetAge:Accordion ID="Accordion1" runat="server" Width="300">
    </DotNetAge:Accordion>
</asp:Content>
